import dayjs from "dayjs";
import {convertToChineseNumber} from '@/utils/commonHooks'
import Edit from '@/assets/images/edit.png';
import Delete from '@/assets/images/delete2.png';
import Add from '@/assets/images/add.png';
import Execute from '@/assets/images/execute.png';
import { keyWorkEditPerm } from '@/utils/index'
const menuMock = [
  {
      "url": "system",
      "permissionCode": "system",
      "permissionName": "系统管理",
      "icon": "system",
      "permissionType": 0,
      "children": [
          {
            "url": "role",
            "permissionCode": "Role",
            "permissionName": "角色管理",
            "icon": "role",
            "permissionType": 1,
          },
          {
            "url": "user",
            "permissionCode": "User",
            "permissionName": "用户管理",
            "icon": "user",
            "permissionType": 1,
          },
          {
            "url": "dict",
            "permissionCode": "Dict",
            "permissionName": "字典管理",
            "icon": "dict",
            "permissionType": 1,
          },
          {
              "url": "menu",
              "permissionCode": "Menu",
              "permissionName": "权限管理",
              "icon": "menu",
              "permissionType": 1,
          },
      ]
  },
  {
      "url": "multi-level",
      "permissionCode": "multiLevel",
      "permissionName": "多级菜单",
      "icon": "cascader",
      "permissionType": 0,
      "children": [
          {
              "url": "multi-level1",
              "permissionCode": "MultiLevel1",
              "permissionName": "菜单一级",
              "permissionType": 0,
              "icon": "",
              "children": [
                  {
                      "url": "multi-level2",
                      "permissionCode": "MultiLevel2",
                      "permissionName": "菜单二级",
                      "icon": "",
                      "permissionType": 0,
                      "children": [
                          {
                              "url": "multi-level3-1",
                              "permissionCode": "MultiLevel31",
                              "permissionName": "菜单三级-1",
                              "icon": "",
                              "permissionType": 1,
                          },
                      ]
                  }
              ]
          }
      ]
  },
  {
      "url": "function",
      "permissionCode": "function",
      "permissionName": "一级菜单404",
      "permissionType": 1,
      "icon": "menu",
      "children": []
  }
]

const mockTasks = {
  data: [
    {
      id: "10",
      text: "P2402100011订单001",
      start_date: "2023-01-07",
      duration: 3,
      done: 6,
      order: 10,
      progress: 0.4,
      total: 10,
      open: true,
    },
    {
      id: 134,
      text: "A01 拉丝",
      start_date: "2025-01-03",
      render: "split",
      parent: "10",
      progress: 0.5,
      total: 10,
      done: 6,
      open: true,
      duration: 11,
    },
    {
      id: 170,
      text: "Stage #1",
      start_date: "2025-01-03",
      duration: 1,
      parent: "134",
      progress: 0,
      open: true,
    },
    {
      id: 180,
      text: "Stage #2",
      start_date: "2025-01-05",
      duration: 1,
      parent: "134",
      progress: 0,
      open: true,
    },
    {
      id: 190,
      text: "Stage #3",
      start_date: "2025-01-08",
      duration: 1,
      parent: "134",
      progress: 0,
      open: true,
    },
    {
      id: 200,
      text: "Stage #4",
      start_date: "2025-01-10",
      duration: 2,
      parent: "134",
      progress: 0,
      open: true,
    },
    {
      id: "1",
      text: "A01 拉丝",
      start_date: "2025-01-06",
      duration: 2,
      order: 10,
      total: 2,
      done: 2,
      progress: 0.6,
      parent: "10",
    },
    {
      id: "3",
      text: "A02 退火",
      start_date: "2025-01-05",
      duration: 2,
      order: 20,
      done: 2,
      progress: 0.6,
      total: 2,
      parent: "10",
    },
    {
      id: "4",
      text: "A03 纹合",
      start_date: "2025-01-05",
      duration: 2,
      order: 20,
      done: 2,
      total: 6,
      progress: 0.6,
      parent: "10",
    },
    {
      id: "20",
      text: "P2402100022订单002",
      start_date: "2025-01-03",
      duration: 3,
      order: 10,
      progress: 0.4,
      done: 5,
      total: 6,
      type: "project",
      open: true,
    },
    {
      id: "13",
      text: "A04 挤出",
      start_date: "2025-01-03",
      duration: 2,
      order: 10,
      done: 2,
      progress: 0.6,
      total: 2,
      parent: "20",
    },
    {
      id: "15",
      text: "A05 成缆",
      start_date: "2025-01-03",
      duration: 2,
      order: 20,
      done: 0,
      progress: 0.6,
      total: 1,
      parent: "20",
    },
    {
      id: "14",
      text: "A06 成品检",
      start_date: "2025-01-03",
      duration: 2,
      order: 20,
      total: 1,
      done: 1,
      progress: 0.6,
      parent: "20",
    },
    {
      id: "2",
      text: "A01 拉丝",
      start_date: "2025-01-05",
      duration: 2,
      order: 20,
      done: 2,
      total: 2,
      progress: 0.6,
      parent: "20",
    },
    {
      id: "7",
      text: "A03 纹合",
      start_date: "2025-01-05",
      duration: 2,
      order: 20,
      done: 1,
      total: 1,
      progress: 0.4,
      parent: "10",
    },
    // 模拟数据
    {
      id: "110",
      text: "P2402100011订单001",
      start_date: "2023-01-07",
      duration: 3,
      done: 6,
      order: 10,
      progress: 0.4,
      total: 10,
      open: true,
    },
    {
      id: "111",
      text: "A01 拉丝",
      start_date: "2025-01-06",
      duration: 2,
      order: 10,
      total: 2,
      done: 2,
      progress: 0.6,
      parent: "10",
    },
    {
      id: "31",
      text: "A02 退火",
      start_date: "2025-01-05",
      duration: 2,
      order: 20,
      done: 2,
      progress: 0.6,
      total: 2,
      parent: "10",
    },
    {
      id: "411",
      text: "A03 纹合",
      start_date: "2025-01-05",
      duration: 2,
      order: 20,
      done: 2,
      total: 6,
      progress: 0.6,
      parent: "10",
    },
    {
      id: "201",
      text: "P2402100022订单002",
      start_date: "2025-01-03",
      duration: 3,
      order: 10,
      progress: 0.4,
      done: 5,
      total: 6,
      type: "project",
      open: true,
    },
    {
      id: "131",
      text: "A04 挤出",
      start_date: "2025-01-03",
      duration: 2,
      order: 10,
      done: 2,
      progress: 0.6,
      total: 2,
      parent: "20",
    },
    {
      id: "151",
      text: "A05 成缆",
      start_date: "2025-01-03",
      duration: 2,
      order: 20,
      done: 0,
      progress: 0.6,
      total: 1,
      parent: "20",
    },
    {
      id: "141",
      text: "A06 成品检",
      start_date: "2025-01-03",
      duration: 2,
      order: 20,
      total: 1,
      done: 1,
      progress: 0.6,
      parent: "20",
    },
    {
      id: "21",
      text: "A01 拉丝",
      start_date: "2025-01-05",
      duration: 2,
      order: 20,
      done: 2,
      total: 2,
      progress: 0.6,
      parent: "20",
    },
    {
      id: "711",
      text: "A03 纹合",
      start_date: "2025-01-05",
      duration: 2,
      order: 20,
      done: 1,
      total: 1,
      progress: 0.4,
      parent: "10",
    },
  ],
  links: [
    { id: 1, source: 1, target: 2, type: "0" },
    { id: 2, source: 2, target: 3, type: "0" },
    { id: 3, source: 3, target: 4, type: "0" },
    { id: 4, source: 2, target: 5, type: "0" },
  ],
}

const mockColumns = [
  {
    name: "text",
    label: "订单/工序",
    tree: true,
    width: 180,
  },
  { name: "add", label: "", width: 44, align: "center" },
  { name: "total", width: 44, label: "数量", align: "center" },
  { name: "done", width: 44, label: "已排", align: "center" },
  {
    name: "start_date",
    label: "开始",
    width: 60,
    align: "center",
    template(task:any) {
      return dayjs(task.start_date).format("MM-DD");
    },
  },
  {
    name: "end_date",
    label: "结束",
    width: 60,
    align: "center",
    template(task:any) {
      return dayjs(task.end_date).format("MM-DD");
    },
  },
]

const mockYearTasks1 = [{
    id: "10",
    taskName: "全力开拓新市场、新业务",
    planStartDate: "2023-01-07",
    planEndDate: "2024-01-07",
    endDateEnd: "2024-01-07",
    seq:"1",
    leaderName: 'jeff',
    completionDegree: 0.5,
    open: true,
    workStatus: "1",
    taskType: 0
  },
  {
    id: "13",
    taskName: "创新制造",
    planStartDate: "2023-02-07",
    planEndDate: "2023-03-08",
    endDateEnd: "2023-03-07",
    seq:"3",
    leaderName: 'haha',
    completionDegree: 0.3,
    open: true,
    workStatus: "1",
    taskType: 0
  },
  {
    id: "12",
    taskName: "全面推广精益生产 建立精益运营系统",
    planStartDate: "2023-02-07",
    planEndDate: "2024-04-07",
    endDateEnd: "2024-04-07",
    seq:"2",
    leaderName: 'jeff',
    completionDegree: 0.3,
    open: true,
    workStatus: "1",
    taskType: 0
  },
  {
    id: "122",
    taskName: "完成制定公司《数智化转型规划》，引领数智化转型工作",
    planStartDate: "2023-01-07",
    planEndDate: "2024-01-07",
    endDateEnd: "2024-01-07",
    seq:"2.1",
    leaderName: 'jeff',
    completionDegree: 0.6,
    open: true,
    parent: "12",
    workStatus: "1",
    taskType: 1
  },
  {
    id: "123",
    taskName: "提升产品价格及成本竞争力",
    planStartDate: "2023-01-07",
    planEndDate: "2024-01-07",
    endDateEnd: "2024-01-07",
    seq:"2.1.1",
    leaderName: 'jeff',
    completionDegree: 0,
    open: true,
    parent: "122",
    workStatus: "0",
    taskType: 2,
    plans: [{
      name: '项目提报数量',
      total: '20',
      unit: '个'
    }, {
      name: '项目提报重量',
      total: '20',
      unit: '吨'
    }]
  },
  {
    id: "1236",
    taskName: "全面推广精益生产 建立精益运营系统",
    planStartDate: "2023-01-07",
    planEndDate: "2024-01-07",
    endDateEnd: "2024-01-07",
    seq:"2.2.2",
    leaderName: 'jeff',
    completionDegree: 1,
    open: true,
    parent: "122",
    workStatus: "2",
    taskType: 2,
    plans: null
  },]

const mockYearTasks = {
  data: [{
    id: "10",
    text: "全力开拓新市场、新业务",
    start_date: "2023-01-07",
    duration: 365,
    done: 6,
    order: 10,
    progress: 0.4,
    total: 10,
    open: true,
  },
  {
    id: "20",
    text: "提升产品价格及成本竞争力",
    start_date: "2023-01-01",
    duration: 360,
    done: 6,
    order: 10,
    progress: 0.4,
    total: 10,
    open: true,
  },
  {
    id: "30",
    text: "提升质量表现 降低质量成本",
    start_date: "2023-01-07",
    duration: 350,
    done: 6,
    order: 10,
    progress: 0.4,
    total: 10,
    open: true,
  },{
    id: "40",
    text: "全面推广精益生产 建立精益运营系统",
    start_date: "2023-03-07",
    duration: 250,
    done: 6,
    order: 10,
    progress: 0.4,
    total: 10,
    open: true,
  },{
    id: "50",
    text: "技术创新",
    start_date: "2023-02-07",
    duration: 256,
    done: 6,
    order: 10,
    progress: 0.4,
    total: 10,
    open: true,
  },{
    id: "60",
    text: "数智化转型",
    start_date: "2023-03-07",
    duration: 250,
    done: 6,
    order: 10,
    progress: 0.4,
    total: 10,
    open: true,
  },{
    id: "70",
    text: "低碳发展",
    start_date: "2023-01-07",
    duration: 350,
    done: 6,
    order: 10,
    progress: 0.4,
    total: 10,
    open: true,
  },
  {
    id: 61,
    text: "完成制定公司《数智化转型规划》，引领数智化转型工作",
    start_date: "2023-01-03",
    parent: "60",
    progress: 0.5,
    total: 200,
    done: 6,
    open: true,
    duration: 11,
  },
  {
    id: 62,
    text: "业务赋能：梳理业务流程，聚焦业务痛点，推进重点项目",
    start_date: "2023-01-03",
    parent: "60",
    progress: 0.5,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },
  {
    id: 611,
    text: "《数智化转型规划》批准、发布；",
    start_date: "2023-01-03",
    parent: "61",
    progress: 0.5,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },
  {
    id: 612,
    text: "《数智化转型规划》滚动修订",
    start_date: "2023-04-03",
    parent: "61",
    progress: 0.5,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },
  {
    id: 621,
    text: "1、研发管理流程；（CAPP+PLM）",
    start_date: "2023-02-02",
    parent: "62",
    progress: 0.6,
    total: 10,
    done: 6,
    open: true,
    duration: 100,
  },{
    id: 622,
    text: "2、订单交付主流程",
    start_date: "2023-04-03",
    parent: "62",
    progress: 0.4,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },{
    id: 623,
    text: "3、质量控制流程",
    start_date: "2023-09-03",
    parent: "62",
    progress: 0.8,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },{
    id: 624,
    text: "4、资产管理流程",
    start_date: "2023-07-03",
    parent: "62",
    progress: 1,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },{
    id: 625,
    text: "5、成本管控流程",
    start_date: "2023-08-03",
    parent: "62",
    progress: 1,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },{
    id: 626,
    text: "6、报价管理流程",
    start_date: "2023-04-03",
    parent: "62",
    progress: 0.9,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  }],
  links: [
    { id: 1, source: 1, target: 2, type: "0" },
    { id: 2, source: 2, target: 3, type: "0" },
    { id: 3, source: 3, target: 4, type: "0" },
    { id: 4, source: 2, target: 5, type: "0" },
  ],
}

const mockYearColumns = [
  {
    name: "text",
    label: "任务名称",
    width: 265,
    tree: true,
    template(task:any) {
      if (!task.parent) {
        return convertToChineseNumber(task.$local_index + 1, 2) + '、' + task.text
      } else {
        return task.text
      }
    },
  },
  {
    name: "add_item", label: "", width: 44, template: () => {
      return `<div ref="addRef" id="button" class="add-item" data-action="add">添加</div>`
    }
  },
  {
    name: "status", label: " ", width: 80, align: "center", template: function (task: any) {
      switch (task.status) {
        case 1:
          return (
            `<div data-show class="progress progress-success">已完成</div>`
          );
        case 2:
          return (
            `<div data-show class="progress progress-todo">待 办</div>`
          );
        case 3:
          return (
            `<div data-show class="progress progress-doing">进行中</div>`
          );
        default:
          return (
            `<div data-show class="progress progress-todo">待办</div>`
          );
      }
    }
  },
  { name: "add", label: "", width: 44, align: "center" },
  { name: "duration", width: 54, label: "持续天数", align: "center" },
  // {
  //   name: "start_date",
  //   label: "开始",
  //   width: 60,
  //   align: "center",
  //   template(task:any) {
  //     return dayjs(task.start_date).format("MM-DD");
  //   },
  // },
  // {
  //   name: "end_date",
  //   label: "结束",
  //   width: 60,
  //   align: "center",
  //   template(task:any) {
  //     return dayjs(task.end_date).format("MM-DD");
  //   },
  // },
]

// 工作任务模拟数据
const mockTaskDatas = {
  data: [{
    id: "10",
    text: "全力开拓新市场、新业务",
    start_date: "2023-01-07",
    duration: 365,
    done: 6,
    order: 10,
    progress: 0.4,
    total: 10,
    open: true,
  },{
    id: "60",
    text: "数智化转型",
    start_date: "2023-03-07",
    duration: 250,
    done: 6,
    order: 10,
    progress: 0.4,
    total: 10,
    open: true,
  },{
    id: "70",
    text: "低碳发展",
    start_date: "2023-01-07",
    duration: 350,
    done: 6,
    order: 10,
    progress: 0.4,
    total: 10,
    open: true,
  },
  {
    id: 61,
    text: "完成制定公司《数智化转型规划》，引领数智化转型工作",
    start_date: "2023-01-03",
    parent: "60",
    progress: 0.5,
    total: 200,
    done: 6,
    open: true,
    duration: 11,
  },
  {
    id: 62,
    text: "业务赋能：梳理业务流程，聚焦业务痛点，推进重点项目",
    start_date: "2023-01-03",
    parent: "60",
    progress: 0.5,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },
  {
    id: 611,
    text: "《数智化转型规划》批准、发布；",
    start_date: "2023-01-03",
    parent: "61",
    progress: 0.5,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },
  {
    id: 612,
    text: "《数智化转型规划》滚动修订",
    start_date: "2023-04-03",
    parent: "61",
    progress: 0.5,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },
  {
    id: 621,
    text: "1、研发管理流程；（CAPP+PLM）",
    start_date: "2023-02-02",
    parent: "62",
    progress: 0.6,
    total: 10,
    done: 6,
    open: true,
    duration: 100,
  },{
    id: 622,
    text: "2、订单交付主流程",
    start_date: "2023-04-03",
    parent: "62",
    progress: 0.4,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },{
    id: 623,
    text: "3、质量控制流程",
    start_date: "2023-09-03",
    parent: "62",
    progress: 0.8,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },{
    id: 624,
    text: "4、资产管理流程",
    start_date: "2023-07-03",
    parent: "62",
    progress: 1,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },{
    id: 625,
    text: "5、成本管控流程",
    start_date: "2023-08-03",
    parent: "62",
    progress: 1,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  },{
    id: 626,
    text: "6、报价管理流程",
    start_date: "2023-04-03",
    parent: "62",
    progress: 0.9,
    total: 10,
    done: 6,
    open: true,
    duration: 110,
  }],
}

// 工作任务模拟表头
const taskManageColumns = [
  { name: "seq", width: 54, label: "序号", align: "center" },
  {
    name: "taskName",
    label: "工作方向/工作要求/工作任务",
    width: 250,
    tree: true,
    template(task:any) {
      return `<span data-title class="taskName">${task.taskName}</span>`;
    },
  },
  // { name: "add", label: "", width: 44, align: "center"},
  { name: "addTask", labelContent: (task) => {
    return `
    <img src=${Add} data-add style="vertical-align: middle;cursor:pointer;">
    `}, width: 35, align: "center",template: (task) => {
    return keyWorkEditPerm(task)?`
    <img src=${Add} data-add style="vertical-align: middle;cursor:pointer;">
    `: ''}
  },
  {
    name: "leaderName",
    label: "负责人",
    width: 50,
    align: "center",
  },
  {
    name: "plansText",
    label: "量化指标",
    width: 100,
    align: "center",
    template(task:any) {
      return `<span class="zhibiao">${task.plansText}</span>`;
    },
  },
  {
    name: "planStartDate",
    label: "开始日期",
    align: "center",
    width: 80,
    template(task:any) {
      return `${task.planStartDate}`;
    },
  },
  {
    name: "planEndDate",
    label: "结束日期",
    align: "center",
    width: 80,
    template(task:any) {
      return `${task.planEndDate}`;
    },
  },
  {
    name: "add_item", label: "操作", width: 60, align: "center" ,template: (task:any) => {
      return keyWorkEditPerm(task)?`
      <img src=${Edit} data-edit style="vertical-align: middle;cursor:pointer;">
      <img src=${Delete} data-delete style="vertical-align: middle;cursor:pointer;">
      `: ''
    }
  },
]

// 工作进展查询完成度
const taskProgressColumns = [
  { name: "seq", width: 54, label: "序号", align: "center" },
  {
    name: "taskName",
    label: "工作方向/工作要求/工作任务",
    width: 300,
    tree: true,
    template(task:any) {
      return `<span data-title class="taskName">${task.taskName}</span>`;
    },
  },
  {
    name: "leaderName",
    label: "负责人",
    width: 60,
    align: "center",
  },
  {
    name: "plansText",
    label: "量化指标",
    width: 100,
    align: "center",
    template(task:any) {
      return `<span class="zhibiao">${task.plansText}</span>`;
    },
  },
  {
    name: "completionDegree",
    label: "完成度",
    width: 60,
    align: "center",
    template(task:any) {
      return (task.workStatus != "2" && dayjs(task.planEndDate).isBefore(dayjs()))?
      `<span data-title class="zhibiao text-red" style="${
        task.ishaveSon ? 'cursor:pointer;text-decoration:underline;' : 'text-decoration:noset;'
      }">${task.completionDegree || 0}%</span>`:
      `<span data-title class="zhibiao" style="${
        task.ishaveSon ? 'cursor:pointer;text-decoration:underline;' : 'text-decoration:noset;'
      }">${task.completionDegree || 0}%</span>`;
    },
  },
]

// 工作任务模拟表头
const taskExecutionColumns = [
  { name: "seq", width: 54, label: "序号", align: "center" },
  {
    name: "taskName",
    label: "工作方向/工作要求/工作任务",
    width: 220,
    tree: true,
    template(task:any) {
      return `<span data-title class="taskName">${task.taskName}</span>`;
    },
  },
  // { name: "add", label: "", width: 44, align: "center"},
  { name: "", label: "", width: 35, align: "center",template: (task) => {
    return keyWorkEditPerm(task) ? `<img src=${Add} data-add style="vertical-align: middle;cursor:pointer;">`: ''}
  },
  {
    name: "leaderName",
    label: "负责人",
    width: 50,
    align: "center",
  },
  {
    name: "plansText",
    label: "量化指标",
    width: 80,
    align: "center",
    template(task:any) {
      return `<span class="zhibiao">${task.plansText}</span>`;
    },
  },
  {
    name: "completionDegree",
    label: "完成度",
    width: 60,
    align: "center",
    template(task:any) {
      return (task.workStatus != "2" && dayjs(task.planEndDate).isBefore(dayjs()))?
      `<span class="zhibiao" style="color:red;">${task.completionDegree || 0}%</span>`:
      `<span class="zhibiao">${task.completionDegree || 0}%</span>`;
    },
  },
  {
    name: "planStartDate",
    label: "开始日期",
    align: "center",
    width: 80,
    template(task:any) {
      return `${task.planStartDate}`;
    },
  },
  {
    name: "planEndDate",
    label: "结束日期",
    align: "center",
    width: 80,
    template(task:any) {
      return `${task.planEndDate}`;
    },
  },
  {
    name: "add_item", label: "操作", width: 80, align: "center", template: (task) => {
      const EditBtn = keyWorkEditPerm(task) ? `<img src=${Edit} data-edit style="vertical-align: middle;cursor:pointer;margin-right:2px;">`: '<span style="width:18px;height:18px;display:inline-block;margin-right:2px;"></span>'
      const DeleteBtn = keyWorkEditPerm(task) ? `<img src=${Delete} data-delete style="vertical-align: middle;cursor:pointer;">`: '<span style="width:18px;height:18px;display:inline-block;margin-right:2px;"></span>'
      const ExecuteBtn = keyWorkEditPerm(task) ? `<img src=${Execute} data-execute style="vertical-align: middle;cursor:pointer;margin-right:2px;">`: '<span style="width:17px;height:17px;display:inline-block;margin-right:2px;"></span>'
      return task.taskType == '0'? '':`
      ${ExecuteBtn}
      ${EditBtn}
      ${DeleteBtn}
      `
    }
  },
]

const layoutMock = [
  {
      "id": "1760580260958703616",
      "createTime": "2024-02-19 17:00:09",
      "lastUpdateTime": "2024-03-04 13:55:53",
      "createdUserId": "1",
      "lastUpdatedUserId": "1",
      "createdUserName": null,
      "lastUpdatedUserName": null,
      "version": null,
      "workbenchId": "1760580260925149184",
      "pageSeq": null,
      "pageName": "1",
      "pageContent": null,
      "pageObject": {
          "Boards": [
              {
                  "static": false,
                  "moved": false,
                  "h": 14,
                  "i": "150",
                  "type": "1",
                  "params": {
                      "workbenchId": "1759495233228832769"
                  },
                  "url": "demo/gridLayoutUse/components/MessageBoard",
                  "w": 6,
                  "x": 18,
                  "name": "消息看板",
                  "y": 0
              },
              {
                  "static": false,
                  "moved": false,
                  "h": 17,
                  "i": "276",
                  "type": "1",
                  "params": {
                      "workbenchId": "1759495233228832769"
                  },
                  "url": "demo/gridLayoutUse/components/BarLine",
                  "w": 12,
                  "x": 6,
                  "name": "双轴折线图",
                  "y": 36
              },
              {
                  "static": false,
                  "moved": false,
                  "h": 17,
                  "i": "321",
                  "type": "1",
                  "params": {
                      "workbenchId": "1759495233228832769"
                  },
                  "url": "demo/gridLayoutUse/components/Gauge",
                  "w": 6,
                  "x": 18,
                  "name": "仪表盘",
                  "y": 36
              },
              {
                  "static": false,
                  "moved": false,
                  "h": 21,
                  "i": "428",
                  "type": "1",
                  "params": {
                      "workbenchId": "1759495233228832769"
                  },
                  "url": "demo/gridLayoutUse/components/Calendar",
                  "w": 10,
                  "x": 0,
                  "name": "日程安排",
                  "y": 53
              },
              {
                  "static": false,
                  "moved": false,
                  h: 14,
                  i: "542",
                  "type": "1",
                  "params": {
                      "workbenchId": "1759495233228832769"
                  },
                  "url": "demo/gridLayoutUse/components/LightLine",
                  "w": 12,
                  "x": 6,
                  name: "折线图",
                  y: 12
              },
              {
                  "static": false,
                  "moved": false,
                  "h": 14,
                  "i": "678",
                  "type": "1",
                  "params": {
                      "workbenchId": "1759495233228832769"
                  },
                  "url": "demo/gridLayoutUse/components/NoticeBoard",
                  "w": 6,
                  "x": 0,
                  "name": "公告看板",
                  "y": 0
              },
              {
                  "static": false,
                  "moved": false,
                  "h": 17,
                  "i": "623",
                  "type": "1",
                  "params": {
                      "workbenchId": "1759495233228832769"
                  },
                  "url": "demo/gridLayoutUse/components/PieReport",
                  "w": 6,
                  "x": 0,
                  "name": "柱状图",
                  "y": 36
              },
              {
                  "static": false,
                  "moved": false,
                  "h": 21,
                  "i": "719",
                  "type": "2",
                  "params": {
                      "workbenchId": "1759495233228832769"
                  },
                  "url": "https://pinia.vuejs.org/zh/",
                  "w": 14,
                  "x": 10,
                  "name": "外部报表",
                  "y": 53
              },
              {
                  "static": false,
                  "moved": false,
                  "h": 22,
                  "i": "848",
                  "type": "1",
                  "params": {
                      "workbenchId": "1760580260925149184"
                  },
                  "url": "demo/gridLayoutUse/components/Gannt",
                  "w": 24,
                  "x": 0,
                  "name": "甘特图",
                  "y": 14
              }
          ]
      },
      "dataBoardList": null,
      "dataBoards": null,
      "backgroundImageId": null,
      "backgroundImageUrl": null,
      "remarks": "",
      "deleted": 0,
      "ids": null
  }
]

const mockProduceLineCards = [
  {
    lineCode: "01",
    lineName: "康明斯1线",
    monitorStatus: "生产",
    productCode: "K256828",
    productName: "空压机箱体",
    planQty: 2,
    qualifiedQty: 0,
    actualQty: 3,
    repairQty: 4,
    scrapQty: 44,
    currentDowntime: 0,
    totalDowntime: 11,
    tactTime: 0,
  },
  {
    lineCode: "120603-1",
    lineName: "装配生产线",
    monitorStatus: "故障",
    productCode: "BEB0300000",
    productName: "电动助力转向装置BEB0300000",
    planQty: 338,
    qualifiedQty: 0,
    actualQty: 0,
    repairQty: 0,
    scrapQty: 0,
    currentDowntime: 0,
    totalDowntime: 0,
    tactTime: 0,
  },
  {
    lineCode: "110902-15",
    lineName: "制造部-康明斯1线",
    monitorStatus: "生产",
    productCode: "5445894",
    productName: "飞轮壳总成",
    planQty: 42,
    qualifiedQty: 0,
    actualQty: 0,
    repairQty: 0,
    scrapQty: 0,
    currentDowntime: 0,
    totalDowntime: 0,
    tactTime: 0,
  },
  {
    lineCode: "014",
    lineName: "康明斯1线",
    monitorStatus: "停产",
    productCode: "K256828",
    productName: "空压机箱体",
    planQty: 2,
    qualifiedQty: 0,
    actualQty: 3,
    repairQty: 4,
    scrapQty: 44,
    currentDowntime: 0,
    totalDowntime: 11,
    tactTime: 0,
  },
  {
    lineCode: "120603-16",
    lineName: "装配生产线",
    monitorStatus: "生产",
    productCode: "BEB0300000",
    productName: "电动助力转向装置BEB0300000",
    planQty: 338,
    qualifiedQty: 0,
    actualQty: 0,
    repairQty: 0,
    scrapQty: 0,
    currentDowntime: 0,
    totalDowntime: 0,
    tactTime: 0,
  },
  {
    lineCode: "1109032-16",
    lineName: "制造部-康明斯1线",
    monitorStatus: "故障",
    productCode: "5445894",
    productName: "飞轮壳总成",
    planQty: 42,
    qualifiedQty: 0,
    actualQty: 0,
    repairQty: 0,
    scrapQty: 0,
    currentDowntime: 0,
    totalDowntime: 0,
    tactTime: 0,
  },
  {
    lineCode: "0143",
    lineName: "康明斯1线",
    monitorStatus: "生产",
    productCode: "K256828",
    productName: "空压机箱体",
    planQty: 2,
    qualifiedQty: 0,
    actualQty: 3,
    repairQty: 4,
    scrapQty: 44,
    currentDowntime: 0,
    totalDowntime: 11,
    tactTime: 0,
  },
  {
    lineCode: "1206033-16",
    lineName: "装配生产线",
    monitorStatus: "生产",
    productCode: "BEB0300000",
    productName: "电动助力转向装置BEB0300000",
    planQty: 338,
    qualifiedQty: 0,
    actualQty: 0,
    repairQty: 0,
    scrapQty: 0,
    currentDowntime: 0,
    totalDowntime: 0,
    tactTime: 0,
  },
  {
    lineCode: "1109023-16ee",
    lineName: "制造部-康明斯1线",
    monitorStatus: "生产",
    productCode: "5445894",
    productName: "飞轮壳总成",
    planQty: 42,
    qualifiedQty: 0,
    actualQty: 0,
    repairQty: 0,
    scrapQty: 0,
    currentDowntime: 0,
    totalDowntime: 0,
    tactTime: 0,
  },
  {
    lineCode: "1109032-16e",
    lineName: "制造部-康明斯1线",
    monitorStatus: "生产",
    productCode: "5445894",
    productName: "飞轮壳总成",
    planQty: 42,
    qualifiedQty: 0,
    actualQty: 0,
    repairQty: 0,
    scrapQty: 0,
    currentDowntime: 0,
    totalDowntime: 0,
    tactTime: 0,
  },
  {
    lineCode: "0143e",
    lineName: "康明斯1线",
    monitorStatus: "生产",
    productCode: "K256828",
    productName: "空压机箱体",
    planQty: 2,
    qualifiedQty: 0,
    actualQty: 3,
    repairQty: 4,
    scrapQty: 44,
    currentDowntime: 0,
    totalDowntime: 11,
    tactTime: 0,
  },
  {
    lineCode: "1206033-16e",
    lineName: "装配生产线",
    monitorStatus: "生产",
    productCode: "BEB0300000",
    productName: "电动助力转向装置BEB0300000",
    planQty: 338,
    qualifiedQty: 0,
    actualQty: 0,
    repairQty: 0,
    scrapQty: 0,
    currentDowntime: 0,
    totalDowntime: 0,
    tactTime: 0,
  },
  {
    lineCode: "1109023-16e",
    lineName: "制造部-康明斯1线",
    monitorStatus: "生产",
    productCode: "5445894",
    productName: "飞轮壳总成",
    planQty: 42,
    qualifiedQty: 0,
    actualQty: 0,
    repairQty: 0,
    scrapQty: 0,
    currentDowntime: 0,
    totalDowntime: 0,
    tactTime: 0,
  },
];

const mockProduceLineTable = [
  {
    lineId: "121212",
    lineCode: "121212",
    lineName: "康明斯1线",
    shutdownReason: "设备故障",
    shutdownTime: "2023-12-25",
  },
  {
    lineId: "12121x2",
    lineCode: "12121x2",
    lineName: "康明斯2线",
    shutdownReason: "设备故障",
    shutdownTime: "2023-12-25",
  },
  {
    lineId: "121212",
    lineCode: "121212",
    lineName: "康明斯1线",
    shutdownReason: "设备故障",
    shutdownTime: "2023-12-25",
  },
  {
    lineId: "12121x2",
    lineCode: "12121x2",
    lineName: "康明斯2线",
    shutdownReason: "设备故障",
    shutdownTime: "2023-12-25",
  },
]

const multiTableData = [
  {
      "id": "1777201946051596290",
      "createTime": "2024-04-09 15:05:41",
      "lastUpdateTime": "2024-04-10 15:10:46",
      "createdUserId": "1",
      "lastUpdatedUserId": "1",
      "createdUserName": "管理员",
      "lastUpdatedUserName": "管理员",
      "version": null,
      "keyworkId": "1772141729425248258",
      "seq": "6.1",
      "taskName": "完成制定公司《数智化转型规划》，引领数智化转型工作",
      "taskType": "1",
      "leaderId": "1",
      "leaderName": "管理员",
      "startDate": null,
      "endDate": null,
      "planStartDate": "2024-03-01 00:00:00",
      "planEndDate": "2025-01-16 00:00:00",
      "completionDegree": "100",
      "finishSituation": null,
      "workStatus": "2",
      "remarks": "",
      "allIds": "1777200315398475778,1777201946051596290",
      "allNames": "六、数智化转型,完成制定公司《数智化转型规划》，引领数智化转型工作",
      "parentTaskId": "1777200315398475778",
      "parent": "1777200315398475778",
      "ids": null,
      // 格式一
      years: ['2024', '2025'],
      months: [[8, 9, 10, 11, 12], [1, 2]],
      percents: [[5, 10, 30, 60, 80], [null, 100]],
      "children": [
          {
              "id": "1777202801207267330",
              "createTime": "2024-04-08 13:17:17",
              "lastUpdateTime": "2024-04-08 16:43:48",
              "createdUserId": "1",
              "lastUpdatedUserId": "1",
              "createdUserName": "管理员",
              "lastUpdatedUserName": "管理员",
              "version": null,
              "keyworkId": "1772141729425248258",
              "seq": "6.1.1",
              "taskName": "《数智化转型规划》批准、发布；",
              "taskType": "2",
              "leaderId": "1",
              "leaderName": "管理员",
              "startDate": null,
              "endDate": null,
              "planStartDate": "2024-03-04 00:00:00",
              "planEndDate": "2024-06-21 00:00:00",
              "completionDegree": "20",
              "finishSituation": null,
              "workStatus": "1",
              "remarks": "",
              "allIds": "1777200315398475778,1777201946051596290,1777202801207267330",
              "allNames": "六、数智化转型,完成制定公司《数智化转型规划》，引领数智化转型工作,《数智化转型规划》批准、发布；",
              "parentTaskId": "1777201946051596290",
              "parent": "1777201946051596290",
              "ids": null,
              years: ['2024', '2025'],
              months: [[8, 9, 10, 11, 12], [1, 2]],
              percents: [[0, 10, 20, 40, 60], [78, 98]],
              "children": [
                  {
                      "id": "1777203096700178433",
                      "createTime": "2024-04-08 15:05:12",
                      "lastUpdateTime": "2024-04-11 16:58:35",
                      "createdUserId": "1",
                      "lastUpdatedUserId": "1",
                      "createdUserName": "管理员",
                      "lastUpdatedUserName": "管理员",
                      "version": null,
                      "keyworkId": "1772141729425248258",
                      "seq": "6.1.12",
                      "taskName": "个人任务",
                      "taskType": "2",
                      "leaderId": "1",
                      "leaderName": "管理员",
                      "startDate": null,
                      "endDate": null,
                      "planStartDate": "2024-02-01 00:00:00",
                      "planEndDate": "2024-04-07 00:00:00",
                      "completionDegree": "20",
                      "finishSituation": null,
                      "workStatus": "1",
                      "remarks": "",
                      "allIds": "1777200315398475778,1777201946051596290,1777202801207267330,1777203096700178433",
                      "allNames": "六、数智化转型,完成制定公司《数智化转型规划》，引领数智化转型工作,《数智化转型规划》批准、发布；,个人任务",
                      "parentTaskId": "1777202801207267330",
                      "parent": "1777202801207267330",
                      "ids": null,
                      "children": [],
                      years: ['2024', '2025'],
                      months: [[8, 9, 10, 11, 12], [1, 2]],
                      percents: [[0, null, 10, null, 70], [99, null]],
                      "plans": null,
                      "grossProfits": [
                          {
                              "id": "1777207695368638466",
                              "createTime": "2024-04-08 13:31:48",
                              "lastUpdateTime": "2024-04-11 16:58:36",
                              "createdUserId": "1",
                              "lastUpdatedUserId": "1",
                              "createdUserName": null,
                              "lastUpdatedUserName": null,
                              "keyworkId": "1772141729425248258",
                              "taskId": "1777203096700178433",
                              "seq": "1",
                              "indexName": "bug单",
                              "planIndexValue": 20,
                              "actualIndexValue": null,
                              "indexUnit": "个",
                              "planFinishDate": "2024-04-04 00:00:00",
                              "actualFinishDate": null,
                              "ids": null
                          },
                          {
                              "id": "1777231200608964609",
                              "createTime": "2024-04-08 15:05:12",
                              "lastUpdateTime": "2024-04-11 16:58:36",
                              "createdUserId": "1",
                              "lastUpdatedUserId": "1",
                              "createdUserName": null,
                              "lastUpdatedUserName": null,
                              "keyworkId": "1772141729425248258",
                              "taskId": "1777203096700178433",
                              "seq": "2",
                              "indexName": "生产",
                              "planIndexValue": 1,
                              "actualIndexValue": null,
                              "indexUnit": "吨",
                              "planFinishDate": "2024-04-07 00:00:00",
                              "actualFinishDate": null,
                              "ids": null
                          }
                      ],
                      "open": true,
                      "files": [],
                      "ishaveSon": false
                  }
              ],
              "plans": null,
              "grossProfits": [
                  {
                      "id": "1777204042230517761",
                      "createTime": "2024-04-08 13:17:17",
                      "lastUpdateTime": "2024-04-08 16:43:48",
                      "createdUserId": "1",
                      "lastUpdatedUserId": "1",
                      "createdUserName": null,
                      "lastUpdatedUserName": null,
                      "keyworkId": "1772141729425248258",
                      "taskId": "1777202801207267330",
                      "seq": "1",
                      "indexName": "合同",
                      "planIndexValue": 20,
                      "actualIndexValue": null,
                      "indexUnit": "个",
                      "planFinishDate": "2024-04-30 00:00:00",
                      "actualFinishDate": null,
                      "ids": null
                  }
              ],
              "open": true,
              "files": [],
              "ishaveSon": true
          },
          {
              "id": "1777203301432545282",
              "createTime": "2024-04-08 14:11:20",
              "lastUpdateTime": "2024-04-08 16:49:14",
              "createdUserId": "1",
              "lastUpdatedUserId": "1",
              "createdUserName": "管理员",
              "lastUpdatedUserName": "管理员",
              "version": null,
              "keyworkId": "1772141729425248258",
              "seq": "6.1.2",
              "taskName": "《数智化转型规划》滚动修订；",
              "taskType": "2",
              "leaderId": "1",
              "leaderName": "管理员",
              "startDate": null,
              "endDate": null,
              "planStartDate": "2024-04-01 00:00:00",
              "planEndDate": "2024-10-31 00:00:00",
              "completionDegree": "100",
              "finishSituation": null,
              "workStatus": "2",
              "remarks": "",
              "allIds": "1777200315398475778,1777201946051596290,1777203301432545282",
              "allNames": "六、数智化转型,完成制定公司《数智化转型规划》，引领数智化转型工作,《数智化转型规划》滚动修订；",
              "parentTaskId": "1777201946051596290",
              "parent": "1777201946051596290",
              "ids": null,
              "children": [],
              "plans": null,
              "grossProfits": null,
              "open": true,
              "files": [],
              "ishaveSon": false
          }
      ],
      "plans": [
          {
              "id": "1777203817604567042",
              "createTime": "2024-04-08 13:16:24",
              "lastUpdateTime": "2024-04-10 15:10:47",
              "createdUserId": "1",
              "lastUpdatedUserId": "1",
              "createdUserName": null,
              "lastUpdatedUserName": null,
              "keyworkId": "1772141729425248258",
              "taskId": "1777201946051596290",
              "seq": "1",
              "planFinishDate": "2024-04-09 00:00:00",
              "completionDegree": "10",
              "ids": null
          }
      ],
      "grossProfits": null,
      "open": true,
      "files": [],
      "ishaveSon": true
  },
  {
      "id": "34be79f2d7e14544987debb9ed2264b0",
      "createTime": "2024-04-12 10:25:09",
      "lastUpdateTime": "2024-04-12 10:25:09",
      "createdUserId": "1",
      "lastUpdatedUserId": "1",
      "createdUserName": "管理员",
      "lastUpdatedUserName": "管理员",
      "version": null,
      "keyworkId": "1772141729425248258",
      "seq": "1",
      "taskName": "创新工厂工作方向",
      "taskType": "0",
      "leaderId": null,
      "leaderName": null,
      "startDate": null,
      "endDate": null,
      "planStartDate": "2024-04-01 00:00:00",
      "planEndDate": "2024-12-26 00:00:00",
      "completionDegree": "100.0",
      "finishSituation": null,
      "workStatus": "0",
      "remarks": "",
      "allIds": "34be79f2d7e14544987debb9ed2264b0",
      "allNames": "创新工厂工作方向",
      "parentTaskId": "0",
      "parent": "0",
      "ids": null,
      "children": [
          {
              "id": "65bd6e18b7e546c9a483ef69d3497cae",
              "createTime": "2024-04-12 13:49:46",
              "lastUpdateTime": "2024-04-12 13:49:46",
              "createdUserId": "1",
              "lastUpdatedUserId": "1",
              "createdUserName": "管理员",
              "lastUpdatedUserName": "管理员",
              "version": null,
              "keyworkId": "1772141729425248258",
              "seq": "1.1",
              "taskName": "工作要求工作要求",
              "taskType": "1",
              "leaderId": "1772109932511481858",
              "leaderName": "苗壮",
              "startDate": null,
              "endDate": null,
              "planStartDate": "2024-04-08 00:00:00",
              "planEndDate": "2024-04-29 00:00:00",
              "completionDegree": "100",
              "finishSituation": null,
              "workStatus": "2",
              "remarks": "工作要求工作要求工作要求",
              "allIds": "34be79f2d7e14544987debb9ed2264b0,65bd6e18b7e546c9a483ef69d3497cae",
              "allNames": "创新工厂工作方向,工作要求工作要求",
              "parentTaskId": "34be79f2d7e14544987debb9ed2264b0",
              "parent": "34be79f2d7e14544987debb9ed2264b0",
              "ids": null,
              "children": [
                  {
                      "id": "bc5b8346d0ee467a8097bc60f6068f56",
                      "createTime": "2024-04-12 13:49:59",
                      "lastUpdateTime": "2024-04-12 13:49:59",
                      "createdUserId": "1",
                      "lastUpdatedUserId": "1",
                      "createdUserName": "管理员",
                      "lastUpdatedUserName": "管理员",
                      "version": null,
                      "keyworkId": "1772141729425248258",
                      "seq": "1.1.1",
                      "taskName": "4.12日工作任务",
                      "taskType": "2",
                      "leaderId": "1772128043415490562",
                      "leaderName": "慕金宏",
                      "startDate": null,
                      "endDate": null,
                      "planStartDate": "2024-04-08 00:00:00",
                      "planEndDate": "2024-04-30 00:00:00",
                      "completionDegree": null,
                      "finishSituation": null,
                      "workStatus": "0",
                      "remarks": "",
                      "allIds": "34be79f2d7e14544987debb9ed2264b0,65bd6e18b7e546c9a483ef69d3497cae,bc5b8346d0ee467a8097bc60f6068f56",
                      "allNames": "创新工厂工作方向,工作要求工作要求,4.12日工作任务",
                      "parentTaskId": "65bd6e18b7e546c9a483ef69d3497cae",
                      "parent": "65bd6e18b7e546c9a483ef69d3497cae",
                      "ids": null,
                      "children": [],
                      "plans": null,
                      "grossProfits": null,
                      "open": true,
                      "files": [],
                      "ishaveSon": false
                  }
              ],
              "plans": null,
              "grossProfits": null,
              "open": true,
              "files": [],
              "ishaveSon": true
          }
      ],
      "plans": null,
      "grossProfits": null,
      "open": true,
      "files": [],
      "ishaveSon": true
  },
  {
      "id": "4c9db4a107664dadac3568db8b6bf2a0",
      "createTime": "2024-04-09 15:05:08",
      "lastUpdateTime": "2024-04-09 15:05:08",
      "createdUserId": "1",
      "lastUpdatedUserId": "1",
      "createdUserName": "管理员",
      "lastUpdatedUserName": "管理员",
      "version": null,
      "keyworkId": "1772141729425248258",
      "seq": "6.2",
      "taskName": "业务赋能：梳理业务流程，聚焦业务痛点，推进重点项目",
      "taskType": "1",
      "leaderId": "1772109932511481858",
      "leaderName": "苗壮",
      "startDate": null,
      "endDate": null,
      "planStartDate": "2024-03-04 00:00:00",
      "planEndDate": "2024-05-31 00:00:00",
      "completionDegree": null,
      "finishSituation": null,
      "workStatus": "0",
      "remarks": "",
      "allIds": "1777200315398475778,4c9db4a107664dadac3568db8b6bf2a0",
      "allNames": "六、数智化转型,业务赋能：梳理业务流程，聚焦业务痛点，推进重点项目",
      "parentTaskId": "1777200315398475778",
      "parent": "1777200315398475778",
      "ids": null,
      "children": [],
      "plans": null,
      "grossProfits": null,
      "open": true,
      "files": [],
      "ishaveSon": false
  }
]
export { multiTableData, menuMock, mockTasks,mockColumns, mockYearTasks, mockYearTasks1, mockTaskDatas, mockYearColumns, taskManageColumns, taskProgressColumns, taskExecutionColumns, layoutMock, mockProduceLineCards, mockProduceLineTable  }
